import request from '@/utils/request'

export function pageTeacher(teacher, current, limit) {
    return request({
        url: `ucenter/teacher/pageTeacher/${current}/${limit}`,
        method: 'post',
        data: teacher
    })
}

export function updateTeacher(teacher) {
    return request({
        url: `ucenter/teacher/updateTeacher`,
        method: 'post',
        data: teacher
    })
}

export function removeByIds(ids) {
    return request({
        url: `ucenter/teacher/deleteTeacherByIds`,
        method: 'post',
        data: ids
    })
}

export function getById(id) {
    return request({
        url: `ucenter/teacher/getTeacherById/${id}`,
        method: 'get',
    })
}

export function saveTeacher(teacher) {
    return request({
        url: `ucenter/teacher/saveTeacher`,
        method: 'put',
        params: { ...teacher },
    })
}

export function getTeacherByName(name) {
    return request({
        url: `ucenter/teacher/getTeacherByName/${name}`,
        method: 'get',
    })
}
